#include "Exception.hpp"


#include <filesystem>
#if (_MSC_VER == 1900)
namespace filesystem = std::experimental::filesystem;
#else
namespace filesystem = std::filesystem;
#endif

#include <boost/lexical_cast.hpp>

using namespace std;
using namespace boost;

ShaderSource::ShaderSource(std::string Source)
{
	//add line numbers:

	m_Source='\n'+Source;

	size_t Pos=0;
	unsigned int i=1;
	while((Pos=m_Source.find("\n", Pos)) != string::npos)
	{
		m_Source.insert(++Pos, lexical_cast<string>(i)+": ");
		i++;
	}
	//std::random_shuffle(m_Source.begin(), m_Source.end());
}

ex_file_class::ex_file_class(string Filename)
{
	this->Filename=Filename;
	this->AbsFilename=lexical_cast<string>(filesystem::absolute(filesystem::path(Filename)));
}